#!/usr/bin/python
# coding:utf-8

import os

ADDON_VER_1 = "1.0"
ADDON_VER_2 = "2.0"
ADDON_VER_3 = "3.0"

SUPPORTED_VERSION = [ADDON_VER_1, ADDON_VER_2, ADDON_VER_3]


class AddOnConfig(object):
    __DEFAULT_CONFIG = None
    __ADDON_CONFIG_INST = None

    @staticmethod
    def inst():
        if AddOnConfig.__ADDON_CONFIG_INST is None:
            AddOnConfig.__ADDON_CONFIG_INST = AddOnConfig()
        return AddOnConfig.__ADDON_CONFIG_INST

    def __init__(self):
        self.install_dir = os.path.abspath("/usr/etc/jkzuc/configs/JAKA/AddOns/")
        self.port_start = 10006
        self.port_end = 10051
        self.iniconf_suffix = "_config.ini"
        # todo：brycen 增加一个iniconf_name  "addon.config.ini" 不与addonName绑定
        self.whitelist_file = "/usr/etc/jkzuc/configs/JAKA/AddOns/.whitelist"
        # 允许安装或启动的最大addon数量
        self.addon_max_limit = 10

    def get_install_dir(self):
        return self.install_dir

    def get_iniconf_suffix(self):
        return self.iniconf_suffix


__all__ = ["AddOnConfig"]
